﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Hired
{
    public partial class activate : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string username = Request.QueryString["username"];
            string activationID = Request.QueryString["activationID"];
            if (username != null && activationID != null)
            {
                if (DBAccount.ActivateAccount(username, activationID))
                {
                    Server.Transfer("activatesuccess.aspx");
                }
                else
                {
                    lblError.Text = "Your username or activation ID is incorrect. Please try again!";
                }
            }
        }

        protected void btnActivate_Click(object sender, EventArgs e)
        {
            Response.Redirect("activate.aspx?username=" + txtUsername.Text + "&activationID=" + txtActivationID.Text);
        }
    }
}